 package com.kaishengit.servlet;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

public class login extends HttpServlet {
	
	List<String> list=new ArrayList<String>();
	


	private static final long serialVersionUID = 1L;

	public void init() throws ServletException {
		
	}
	
	
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		HttpSession session =request.getSession();
		
		String nicheng =request.getParameter("nicheng");
		session.setAttribute("key", nicheng);
		
		ServletContext b = getServletContext();
		list.add(nicheng);
		b.setAttribute("online",list);
		response.sendRedirect("tiaozhuan.jspx");
		
	}

	public void destroy() {
		
	}
	
	
	
}
